home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / include / error.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  15.8 KB  |  444 lines

  1. #ifndef _ERROR_H_
  2. #define _ERROR_H_
  3. /*
  4.  *   $RCSfile: error.h,v $  
  5.  *   $Revision: 1.1.1.1 $  
  6.  *   $Date: 1996/05/04 21:55:08 $      
  7.  */ 
  8. #ifndef __ERROR_H__
  9. #define __ERROR_H__
  10. /**********************************************************************
  11. * EXODUS Database Toolkit Software
  12. * Copyright (c) 1991 Computer Sciences Department, University of
  13. *                    Wisconsin -- Madison
  14. * All Rights Reserved.
  15. *
  16. * Permission to use, copy, modify and distribute this software and its
  17. * documentation is hereby granted, provided that both the copyright
  18. * notice and this permission notice appear in all copies of the
  19. * software, derivative works or modified versions, and any portions
  20. * thereof, and that both notices appear in supporting documentation.
  21. *
  22. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  23. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  24. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  25. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  26. *
  27. * The EXODUS Project Group requests users of this software to return 
  28. * any improvements or extensions that they make to:
  29. *
  30. *   EXODUS Project Group 
  31. *     c/o David J. DeWitt and Michael J. Carey
  32. *   Computer Sciences Department
  33. *   University of Wisconsin -- Madison
  34. *   Madison, WI 53706
  35. *
  36. *     or exodus@cs.wisc.edu
  37. *
  38. * In addition, the EXODUS Project Group requests that users grant the 
  39. * Computer Sciences Department rights to redistribute these changes.
  40. **********************************************************************/
  41.  
  42. /*
  43.  *    Functions for using error codes and messages
  44.  */
  45. BEGIN_EXTERNC
  46.  
  47. extern void     initErrorCodes();
  48. extern char*    errorCodeString(int);
  49. extern char*    errorBaseString(int);
  50. extern char*    errorIdString(int);
  51. extern FILE*    sm_ErrorStream;
  52. extern void        SM_Error(int, int, char *, int);
  53. END_EXTERNC
  54.  
  55. typedef struct {
  56.  
  57.     int        code;
  58.     char    *id;
  59.     char    *message;
  60.  
  61. } ERRORINFO;
  62.  
  63.  
  64. typedef struct {
  65.  
  66.     int         errorBase;
  67.     int        maxErrorNum;    /* number of error codes in base */
  68.     char    *baseId;
  69.     char    *baseMessage;
  70. } ERRORBASEINFO;
  71.  
  72.  
  73. /*
  74.  *    Arrays of error code/messages
  75.  */
  76. extern ERRORBASEINFO ErrorBaseInfo[];
  77. extern ERRORINFO *ErrorBase[];
  78. extern BOOL         ErrorBaseInit;
  79. extern ERRORINFO UNIX_ErrorInfo[];
  80. extern ERRORINFO GENERAL_ErrorInfo[];
  81. extern ERRORINFO SM_ErrorInfo[];
  82. extern ERRORINFO BF_ErrorInfo[];
  83. extern ERRORINFO LG_ErrorInfo[];
  84. extern ERRORINFO EH_ErrorInfo[];
  85. extern ERRORINFO FI_ErrorInfo[];
  86. extern ERRORINFO IO_ErrorInfo[];
  87. extern ERRORINFO MSG_ErrorInfo[];
  88. extern ERRORINFO THREAD_ErrorInfo[];
  89. extern ERRORINFO BM_ErrorInfo[];
  90. extern ERRORINFO TRANS_ErrorInfo[];
  91. extern ERRORINFO LM_ErrorInfo[];
  92. extern ERRORINFO LOG_ErrorInfo[];
  93. extern ERRORINFO RESOURCE_ErrorInfo[];
  94. extern ERRORINFO RECOVER_ErrorInfo[];
  95. extern ERRORINFO IM_ErrorInfo[];
  96. extern ERRORINFO OPT_ErrorInfo[];
  97. extern ERRORINFO DISTR_ErrorInfo[];
  98.  
  99.  
  100. /* BEGIN visible to user */
  101.  
  102. /*
  103.  *    Define types of storage manager errors
  104.  */
  105. #define TYPE_USER        0
  106. #define TYPE_LOG        1
  107. #define TYPE_WARNING    2
  108. #define TYPE_SYS        3
  109. #define TYPE_FATAL        4 /* kill server and dump core */
  110. #define TYPE_CRASH        5
  111.     /* 
  112.      *    TYPE_CRASH is used for errors which the storage manager 
  113.      *     should be able to "handle" but are not dealt with at
  114.      *     this time
  115.      */
  116. #define TYPE_STOP        6 
  117. #define TYPE_QUIET        7 /* like TYPE_STOP but no message given */
  118.     
  119.  
  120. /*
  121.  *    Macro to encode error code as a base number in the upper 16 bits
  122.  *    and an error number in the lower 16 bits
  123.  */
  124. #define    SM_ERR_ENCODE(_base, _number)                    \
  125.     ( ((_base) << 16) + (_number) )
  126.  
  127.  
  128. /*
  129.  *    Macro to decode the error number
  130.  */
  131. #define    SM_ERR_DECODE(_code)                    \
  132.     (  (_code) & (0x0000FFFF ) )
  133.  
  134. /*
  135.  *    Macro to decode the base number for the error
  136.  */
  137. #define    SM_ERR_BASE_DECODE(_code)                    \
  138.     (  (_code) >> 16 )
  139.  
  140.  
  141. #define UNIX_ERROR_BASE            0
  142. #define GENERAL_ERROR_BASE        1
  143. #define SM_ERROR_BASE            2
  144. #define BF_ERROR_BASE            3
  145. #define LG_ERROR_BASE            4
  146. #define EH_ERROR_BASE            5
  147. #define FI_ERROR_BASE            6
  148. #define IO_ERROR_BASE            7
  149. #define MSG_ERROR_BASE            8
  150. #define THREAD_ERROR_BASE        9
  151. #define BM_ERROR_BASE            10
  152. #define TRANS_ERROR_BASE        11
  153. #define LOCK_ERROR_BASE            12
  154. #define LOG_ERROR_BASE            13
  155. #define RESOURCE_ERROR_BASE        14
  156. #define RECOVER_ERROR_BASE        15
  157. #define IM_ERROR_BASE            16
  158. #define OPT_ERROR_BASE            17
  159. #define DISTR_ERROR_BASE        18
  160. #define MAX_ERROR_BASE            19     /* always last */
  161.  
  162. /*
  163.  *    The unix errors are defined in /usr/include/errno.h
  164.  */
  165. #define MAX_UNIX_ERROR            0x0fffffff /* unknown */
  166.  
  167. /*
  168.  *    define the general errors
  169.  */
  170. #define esmINTERNAL                SM_ERR_ENCODE(GENERAL_ERROR_BASE, 1)
  171. #define esmASSERT                SM_ERR_ENCODE(GENERAL_ERROR_BASE, 2)
  172. #define esmMALLOCFAILED            SM_ERR_ENCODE(GENERAL_ERROR_BASE, 3)
  173. #define esmSERVERDIED            SM_ERR_ENCODE(GENERAL_ERROR_BASE, 4)
  174. #define esmNOTIMPLEMENTED        SM_ERR_ENCODE(GENERAL_ERROR_BASE, 5)
  175. #define esmUNIXSIGNAL            SM_ERR_ENCODE(GENERAL_ERROR_BASE, 6)
  176. #define esmPOOLEMPTY            SM_ERR_ENCODE(GENERAL_ERROR_BASE, 7)
  177. #define MAX_GENERAL_ERROR        8 /* adjust as errors added/removed */
  178.  
  179. /*
  180.  *    define the sm layer errors
  181.  */
  182. #define esmBADOID                SM_ERR_ENCODE(SM_ERROR_BASE, 1)
  183. #define esmBADSTART                SM_ERR_ENCODE(SM_ERROR_BASE, 2)
  184. #define esmNOFREEUSERDESC        SM_ERR_ENCODE(SM_ERROR_BASE, 3)
  185. #define esmBADUSERDESC            SM_ERR_ENCODE(SM_ERROR_BASE, 4)
  186. #define esmBADPARAMS            SM_ERR_ENCODE(SM_ERROR_BASE, 5)
  187. #define esmBADGROUP                SM_ERR_ENCODE(SM_ERROR_BASE, 6)
  188. #define esmBADLENGTH            SM_ERR_ENCODE(SM_ERROR_BASE, 7)
  189. #define esmROOTNAMETOOLONG        SM_ERR_ENCODE(SM_ERROR_BASE, 8)
  190. #define esmNOFREESCANDESC        SM_ERR_ENCODE(SM_ERROR_BASE, 9)
  191. #define esmENDOFOBJECT            SM_ERR_ENCODE(SM_ERROR_BASE, 10)
  192. #define esmBADSLOTTEDMAGIC        SM_ERR_ENCODE(SM_ERROR_BASE, 11)
  193. #define esmBADOBJECTMAGIC        SM_ERR_ENCODE(SM_ERROR_BASE, 12)
  194. #define esmBADOBJECTFLAGS        SM_ERR_ENCODE(SM_ERROR_BASE, 13)
  195. #define esmNOFREELOADDESC        SM_ERR_ENCODE(SM_ERROR_BASE, 14)
  196. #define esmHISTORYGRAPHOID        SM_ERR_ENCODE(SM_ERROR_BASE, 15)
  197. #define esmNOTVERSIONED            SM_ERR_ENCODE(SM_ERROR_BASE, 16) /* obj not a version */
  198. #define esmNOTFROZEN            SM_ERR_ENCODE(SM_ERROR_BASE, 17) /* obj not frozen */
  199. #define esmFROZEN                SM_ERR_ENCODE(SM_ERROR_BASE, 18) /* obj is frozen */
  200. #define esmVHGTOOLARGE            SM_ERR_ENCODE(SM_ERROR_BASE, 19) 
  201. #define MAX_SM_ERROR            20 /* adjust as errors added/removed */
  202.  
  203.  
  204. /*
  205.  *    define the bf related error
  206.  */
  207. #define esmCANTSWAP                SM_ERR_ENCODE(BF_ERROR_BASE, 1)
  208. #define esmFIXEDPAGES            SM_ERR_ENCODE(BF_ERROR_BASE, 2)
  209. #define esmNOFREEPAGEHASH        SM_ERR_ENCODE(BF_ERROR_BASE, 3)
  210. #define esmNOUNRESERVED            SM_ERR_ENCODE(BF_ERROR_BASE, 4)
  211. #define esmNOFREEGROUPS            SM_ERR_ENCODE(BF_ERROR_BASE, 5)
  212. #define esmBADREPLACEPOLICY        SM_ERR_ENCODE(BF_ERROR_BASE, 6)
  213. #define esmPAGEGONE                SM_ERR_ENCODE(BF_ERROR_BASE, 7)
  214. #define esmNOBUFSPACE            SM_ERR_ENCODE(BF_ERROR_BASE, 8)
  215. #define esmREQUESTTOOBIG        SM_ERR_ENCODE(BF_ERROR_BASE, 9)
  216. #define esmGROUPGONE            SM_ERR_ENCODE(BF_ERROR_BASE, 10)
  217. #define esmNOSHMSPACE            SM_ERR_ENCODE(BF_ERROR_BASE, 11)
  218. #define MAX_BF_ERROR            12 /* adjust as errors added/removed */
  219.  
  220.  
  221. /*
  222.  *    define the large object related errors
  223.  */
  224. #define esmBADRANGE                SM_ERR_ENCODE(LG_ERROR_BASE, 1)
  225. #define esmNOFREELGNODELIST        SM_ERR_ENCODE(LG_ERROR_BASE, 2)
  226. #define MAX_LG_ERROR            3 /* adjust as errors added/removed */
  227.  
  228. /*
  229.  *    define the error handler related errors
  230.  */
  231. #define MAX_EH_ERROR            0 /* adjust as errors added/removed */
  232.  
  233. /*
  234.  *    define the file layer errors
  235.  */
  236. #define esmEMPTYFILE            SM_ERR_ENCODE(FI_ERROR_BASE, 1)
  237. #define esmBADNEARTYPE            SM_ERR_ENCODE(FI_ERROR_BASE, 2)
  238. #define esmBADFILEPAGEMAGIC        SM_ERR_ENCODE(FI_ERROR_BASE, 3)
  239. #define esmAFTERLASTPID            SM_ERR_ENCODE(FI_ERROR_BASE, 4)
  240. #define esmBEFOREFIRSTPID        SM_ERR_ENCODE(FI_ERROR_BASE, 5)
  241. #define esmFILESTACKOVERFLOW    SM_ERR_ENCODE(FI_ERROR_BASE, 6)
  242. #define esmFILEPAGENOTFOUND        SM_ERR_ENCODE(FI_ERROR_BASE, 7)
  243. #define esmNOFREEFILESTACK        SM_ERR_ENCODE(FI_ERROR_BASE, 8)
  244. #define esmPAGEEXISTS            SM_ERR_ENCODE(FI_ERROR_BASE, 9)
  245. #define esmPAGEMARKED            SM_ERR_ENCODE(FI_ERROR_BASE, 10)
  246. #define esmBADFID                SM_ERR_ENCODE(FI_ERROR_BASE, 11)
  247. #define esmNOFREEFIDHASH        SM_ERR_ENCODE(FI_ERROR_BASE, 12)
  248. #define esmFILENOTLOGICAL        SM_ERR_ENCODE(FI_ERROR_BASE, 13)
  249. #define esmBADPAGESIZE            SM_ERR_ENCODE(FI_ERROR_BASE, 14)
  250. #define esmBADFILEHEADERMAGIC    SM_ERR_ENCODE(FI_ERROR_BASE, 15)
  251. #define esmNOFREEOPENFILE        SM_ERR_ENCODE(FI_ERROR_BASE, 16)
  252. #define MAX_FILE_ERROR            17 /* adjust as errors added/removed */
  253.  
  254.  
  255. /*
  256.  *    define the io related errors
  257.  */
  258. #define esmBADVOLHEADER            SM_ERR_ENCODE(IO_ERROR_BASE, 1)
  259. #define esmDUPVOLID                SM_ERR_ENCODE(IO_ERROR_BASE, 2)
  260. #define esmDISKPROCDIED            SM_ERR_ENCODE(IO_ERROR_BASE, 3)
  261. #define esmBADVOLID                SM_ERR_ENCODE(IO_ERROR_BASE, 4)
  262. #define esmDUPVOLNAME            SM_ERR_ENCODE(IO_ERROR_BASE, 5)
  263. #define esmFRAGMENTED            SM_ERR_ENCODE(IO_ERROR_BASE, 6)
  264. #define esmDISKFULL                SM_ERR_ENCODE(IO_ERROR_BASE, 7)
  265. #define esmDISKMOUNTED            SM_ERR_ENCODE(IO_ERROR_BASE, 8)
  266. #define esmBADROOTNAME            SM_ERR_ENCODE(IO_ERROR_BASE, 9)
  267. #define esmROOTTABLEFULL        SM_ERR_ENCODE(IO_ERROR_BASE, 10)
  268. #define esmNOVOLINFO            SM_ERR_ENCODE(IO_ERROR_BASE, 11)
  269. #define esmNOFREECONTEXT        SM_ERR_ENCODE(IO_ERROR_BASE, 12)
  270. #define esmBADPID                SM_ERR_ENCODE(IO_ERROR_BASE, 13)
  271. #define esmSERVPROCDIED            SM_ERR_ENCODE(IO_ERROR_BASE, 14)
  272. #define esmNOSUCHVOLUME            SM_ERR_ENCODE(IO_ERROR_BASE, 15)
  273. #define esmMOUNTTABLEFULL        SM_ERR_ENCODE(IO_ERROR_BASE, 16)
  274.  
  275. #define MAX_IO_ERROR            17 /* adjust as errors added/removed */
  276.  
  277.  
  278. /*
  279.  *    define the message related errors
  280.  */
  281. #define esmPROTOCOLVERSION        SM_ERR_ENCODE(MSG_ERROR_BASE, 1)
  282. #define esmBADMESSAGENUMBER        SM_ERR_ENCODE(MSG_ERROR_BASE, 2)
  283. #define esmBADMESSAGEMAGIC        SM_ERR_ENCODE(MSG_ERROR_BASE, 3)
  284. #define esmALREADYCONNECTED        SM_ERR_ENCODE(MSG_ERROR_BASE, 4)
  285. #define esmNOTCONNECTED            SM_ERR_ENCODE(MSG_ERROR_BASE, 5)
  286. #define esmNOFREETIMERS            SM_ERR_ENCODE(MSG_ERROR_BASE, 6)
  287. #define esmUNKNOWNHOSTNAME      SM_ERR_ENCODE(MSG_ERROR_BASE, 7)
  288. #define esmCONFIGMISMATCH        SM_ERR_ENCODE(MSG_ERROR_BASE, 8)
  289. #define esmBADFAMILY            SM_ERR_ENCODE(MSG_ERROR_BASE, 9)
  290. #define MAX_MSG_ERROR          10 /* adjust as errors added/removed */
  291.  
  292.  
  293. /*
  294.  *    define the thread related errors
  295.  */
  296. #define esmNOFREETHREAD            SM_ERR_ENCODE(THREAD_ERROR_BASE, 1)
  297. #define MAX_THREAD_ERROR        2 /* adjust as errors added/removed */
  298.  
  299.  
  300. /*
  301.  *    define the bitmap related error
  302.  */
  303. #define esmNOFREEPAGECONTEXT    SM_ERR_ENCODE(BM_ERROR_BASE, 1)
  304. #define esmTOOMANYBITS            SM_ERR_ENCODE(BM_ERROR_BASE, 2)
  305. #define MAX_BM_ERROR            3 /* adjust as errors added/removed */
  306.  
  307.  
  308. /*
  309.  *    define the transaction related errors
  310.  */
  311. #define esmNOFREETRANSREC        SM_ERR_ENCODE(TRANS_ERROR_BASE, 1)
  312. #define esmTRANSDISABLED        SM_ERR_ENCODE(TRANS_ERROR_BASE, 2)
  313. #define esmBADTRANSID            SM_ERR_ENCODE(TRANS_ERROR_BASE, 3)
  314. #define esmNOTTRANSMASTER        SM_ERR_ENCODE(TRANS_ERROR_BASE, 4)
  315. #define esmTRANSABORTED            SM_ERR_ENCODE(TRANS_ERROR_BASE, 5)
  316. #define esmTRANSCOMMITTED        SM_ERR_ENCODE(TRANS_ERROR_BASE, 6)
  317. #define esmNOFREETRANSVOLREC    SM_ERR_ENCODE(TRANS_ERROR_BASE, 7)
  318. #define esmTRANSINPROGRESS        SM_ERR_ENCODE(TRANS_ERROR_BASE, 8)
  319. #define esmNOACTIVETRANS        SM_ERR_ENCODE(TRANS_ERROR_BASE, 9)
  320. #define esmCLIENTREQUEST        SM_ERR_ENCODE(TRANS_ERROR_BASE, 10)
  321. #define MAX_TRANS_ERROR            11 /* adjust as errors added/removed */
  322.  
  323.  
  324. /*
  325.  *    define the locking related errors
  326.  */
  327. #define esmBADLOCKTABLESIZE        SM_ERR_ENCODE(LOCK_ERROR_BASE, 1)
  328. #define esmBADLOCKMODE            SM_ERR_ENCODE(LOCK_ERROR_BASE, 2)
  329. #define esmNOFREELOCKHEADER        SM_ERR_ENCODE(LOCK_ERROR_BASE, 3)
  330. #define esmNOFREELOCKENTRY        SM_ERR_ENCODE(LOCK_ERROR_BASE, 4)
  331. #define esmNOFREELOCKCLASSREC    SM_ERR_ENCODE(LOCK_ERROR_BASE, 5)
  332. #define esmNOFREELOCKCLASS        SM_ERR_ENCODE(LOCK_ERROR_BASE, 6)
  333. #define esmBADLOCKCLASS            SM_ERR_ENCODE(LOCK_ERROR_BASE, 7)
  334. #define esmLOCKBUSY                SM_ERR_ENCODE(LOCK_ERROR_BASE, 8)
  335. #define esmLOCKCAUSEDDEADLOCK    SM_ERR_ENCODE(LOCK_ERROR_BASE, 9)
  336. #define esmNOSUCHLOCK            SM_ERR_ENCODE(LOCK_ERROR_BASE, 10)
  337. #define esmWAITEREXISTS            SM_ERR_ENCODE(LOCK_ERROR_BASE, 11)
  338. #define esmPHANTOMDEADLOCK        SM_ERR_ENCODE(LOCK_ERROR_BASE, 12)
  339. #define esmCAUSEDPHANTOMDEADLOCK SM_ERR_ENCODE(LOCK_ERROR_BASE, 13)
  340. #define esmLOCKPREEMPTED         SM_ERR_ENCODE(LOCK_ERROR_BASE, 14)
  341. #define MAX_LOCK_ERROR            15 /* adjust as errors added/removed */
  342.  
  343.  
  344. /*
  345.  *    define the logging related errors
  346.  */
  347. #define esmLOGDISABLED            SM_ERR_ENCODE(LOG_ERROR_BASE, 1)
  348. #define esmLOGWRAPPED            SM_ERR_ENCODE(LOG_ERROR_BASE, 2)
  349. #define esmNOFREELOGSPACE        SM_ERR_ENCODE(LOG_ERROR_BASE, 3)
  350. #define esmLOGRECORDTOOBIG        SM_ERR_ENCODE(LOG_ERROR_BASE, 4)
  351. #define esmBADLOGPAGEHEADER        SM_ERR_ENCODE(LOG_ERROR_BASE, 5)
  352. #define esmBADLOGRECORDHEADER    SM_ERR_ENCODE(LOG_ERROR_BASE, 6)
  353. #define esmBADLOGVOLUME            SM_ERR_ENCODE(LOG_ERROR_BASE, 7)
  354. #define esmMOUNTLSNTOOHIGH        SM_ERR_ENCODE(LOG_ERROR_BASE, 8)
  355. #define esmLOGTOOSMALL            SM_ERR_ENCODE(LOG_ERROR_BASE, 9)
  356. #define esmLOGGINGOFF            SM_ERR_ENCODE(LOG_ERROR_BASE, 10)
  357. #define MAX_LOG_ERROR            11 /* adjust as errors added/removed */
  358.  
  359.  
  360. /*
  361.  *    define the resource related errors
  362.  */
  363. #define esmBADRESOURCE            SM_ERR_ENCODE(RESOURCE_ERROR_BASE, 1)
  364. #define MAX_RESOURCE_ERROR        2 /* adjust as errors added/removed */
  365.  
  366.  
  367. /*
  368.  *    define the recovery related errors
  369.  */
  370. #define    esmCANNOTRECOVER        SM_ERR_ENCODE(RECOVER_ERROR_BASE, 1)
  371. #define MAX_RECOVER_ERROR        2 /* adjust as errors added/removed */
  372.  
  373.  
  374. /*
  375.  *    define the Index Manager related errors
  376.  */
  377. #define esmKEYNOTFOUND            SM_ERR_ENCODE(IM_ERROR_BASE, 1)
  378. #define esmKEYALREADYEXISTS        SM_ERR_ENCODE(IM_ERROR_BASE, 2)
  379. #define esmDUPLICATEKEYPID        SM_ERR_ENCODE(IM_ERROR_BASE, 3)
  380. #define esmKEYTOOLONG            SM_ERR_ENCODE(IM_ERROR_BASE, 4)
  381. #define esmMAXKEYLENEXCEEDED    SM_ERR_ENCODE(IM_ERROR_BASE, 5)
  382. #define esmOIDNOTFOUND            SM_ERR_ENCODE(IM_ERROR_BASE, 6)
  383. #define esmOIDEXISTS            SM_ERR_ENCODE(IM_ERROR_BASE, 7)
  384. #define esmINVALIDDIRECTION        SM_ERR_ENCODE(IM_ERROR_BASE, 8)
  385. #define esmSCANEXHAUST            SM_ERR_ENCODE(IM_ERROR_BASE, 9)
  386. #define esmINVALIDCURSOR        SM_ERR_ENCODE(IM_ERROR_BASE, 10)
  387. #define esmINVALIDCOND            SM_ERR_ENCODE(IM_ERROR_BASE, 11)
  388. #define esmCONFLICTCOND            SM_ERR_ENCODE(IM_ERROR_BASE, 12)
  389. #define esmBULKLOADING          SM_ERR_ENCODE(IM_ERROR_BASE, 13)
  390. #define esmINDEXNOTEMPTY        SM_ERR_ENCODE(IM_ERROR_BASE, 14)
  391. #define esmNEEDTEMPVOL            SM_ERR_ENCODE(IM_ERROR_BASE, 15)
  392. #define esmWRONGNDXTYPE            SM_ERR_ENCODE(IM_ERROR_BASE, 16)
  393. #define esmWRONGHASHLOAD        SM_ERR_ENCODE(IM_ERROR_BASE, 17)
  394. #define MAX_IM_ERROR            18 /* adjust as errors added/removed */
  395.  
  396. /*
  397.  *    define the option processing related errors
  398.  */
  399. #define esmBADOPTION            SM_ERR_ENCODE(OPT_ERROR_BASE, 1)
  400. #define esmOPTIONSYNTAX            SM_ERR_ENCODE(OPT_ERROR_BASE, 2)
  401. #define esmOPTIONNOTUNIQUE        SM_ERR_ENCODE(OPT_ERROR_BASE, 3)
  402. #define esmOPTIONNOTSET            SM_ERR_ENCODE(OPT_ERROR_BASE, 4)
  403. #define esmBADOPTIONCLASS        SM_ERR_ENCODE(OPT_ERROR_BASE, 5)
  404. #define esmBADOPTIONVALUE        SM_ERR_ENCODE(OPT_ERROR_BASE, 6)
  405. #define esmBUFPAGESNOTSET        SM_ERR_ENCODE(OPT_ERROR_BASE, 7)
  406. #define MAX_OPT_ERROR            8 /* adjust as errors added/removed */
  407.  
  408. /*
  409.  *    define the distributed transaction related errors
  410.  */
  411. #define esmTRANSNOTPREPARED        SM_ERR_ENCODE(DISTR_ERROR_BASE, 1)
  412. #define esmBADCOMMAND            SM_ERR_ENCODE(DISTR_ERROR_BASE, 2)
  413. #define esmNOFREEGTIDREC        SM_ERR_ENCODE(DISTR_ERROR_BASE, 3)
  414. #define esmTOOMANYSERVERS        SM_ERR_ENCODE(DISTR_ERROR_BASE, 4)
  415. #define esmNOFREESERVERTIDINFO    SM_ERR_ENCODE(DISTR_ERROR_BASE, 5)
  416. #define esmBADHANDLE            SM_ERR_ENCODE(DISTR_ERROR_BASE, 6)
  417. #define esmWOULDBLOCK            SM_ERR_ENCODE(DISTR_ERROR_BASE, 7)
  418. #define esmBADVOTE                SM_ERR_ENCODE(DISTR_ERROR_BASE, 8)
  419. #define esmBADSTATE                SM_ERR_ENCODE(DISTR_ERROR_BASE, 9)
  420. #define esmCOORDUNKNOWN            SM_ERR_ENCODE(DISTR_ERROR_BASE, 10)
  421. #define esmTRANSPREPARED        SM_ERR_ENCODE(DISTR_ERROR_BASE, 11)
  422. #define esmTRANSIN2PC            SM_ERR_ENCODE(DISTR_ERROR_BASE, 12)
  423. #define esmTRANSNOTIN2PC        SM_ERR_ENCODE(DISTR_ERROR_BASE, 13)
  424. #define MAX_DISTR_ERROR            14 /* adjust as errors added/removed */
  425.  
  426. /*
  427.  *    Define error for handling macros
  428.  */
  429. #define SM_ERROR(type, code)                    \
  430.     SM_Error((type), (code), __FILE__, __LINE__)
  431. /* END visible to user */
  432.  
  433. #ifndef SERVER_MAKE
  434. /* BEGIN visible to user */
  435. #define SM_TRANSABORTED(type, reason)    \
  436.     sm_reason = reason;\
  437.     SM_Error((type), esmTRANSABORTED, __FILE__, __LINE__)
  438. /* END visible to user */
  439. #endif SERVER_MAKE
  440.  
  441.  
  442. #endif __ERROR_H__
  443. #endif /* _ERROR_H_ */
  444.